
#include<at89x52.h>
void delay(int x)
{
while(x--)
{
int a,b;
for(a=0;a<200;a++)

for(b=0;b<10;b++);
;

}
}


void main()
{
unsigned char choose[8]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
unsigned char choosf[8]={0xfe,0xfd,0xfb,0xf7,0xef,0xdf,0xbf,0x7f};
unsigned char tiao[16]={0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x77,0x7c,0x39,0x5e,0x79,0x71};
int i,j;
while(1)
{
P0=0xff;
for(i=7;i>=0;i--)
{
for(j=0;j<16;j++)
{
 P1=choose[i];
 P0=tiao[j];
 P1=choose[i];
 delay(20);
}
}
P0=0x00;
delay(10);
}
}